package com.dy.service;

import com.dy.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @ClassName:
 * @Author: 仄言in
 * @Desctiption: (描述)
 * @Date: 2021/4/14 13:05
 * @Version 1.0 (版本)
 */
@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER",fallbackFactory =UserHystrixFallbackFactory.class )
public interface FeignUserService {
    //查询
    @GetMapping("/select")
    List select();
    //id查询
    @GetMapping("/selectById/{uid}")    //加上@PahtVariable的value属性，要不然会启动报错
    User selectById(@PathVariable(value ="uid") Integer uid);
}
